home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / rdcf.exe / FILES.DOC < prev    next >
Text File  |  1993-01-15  |  15KB  |  421 lines

  1.        FILES - A Small File and Directory Manipulation Utility for DOS
  2.  
  3.                             by Philip J. Erdelsky
  4.                           PLAIN VANILLA CORPORATION
  5.                             CompuServe 75746,3411
  6.                       InterNet 75746.3411@compuserve.com
  7.  
  8.                                January 15, 1993
  9.  
  10.                    PUBLIC DOMAIN -- NO RESTRICTIONS ON USE
  11.  
  12. 1. Introduction
  13. ---------------
  14.  
  15. The FILES utility is a small file and directory manipulation utility for DOS
  16. (versions 2.00 and later).  It was written mainly to test RDCF 2.0 and
  17. duplicates a number of DOS internal and external commands, but it adds enough
  18. functions to DOS to be useful in itself.
  19.  
  20. Here is what you can do with the FILES utility that you cannot do with DOS
  21. commands alone:
  22.  
  23.      (1) You can see hidden, system and deleted files and volume labels in
  24.          directory listings. (You can see hidden and system files, but not
  25.          deleted files, with DOS 5.0.)
  26.  
  27.      (2) You can change the date and time of a file, directory or volume
  28.          label.
  29.  
  30.      (3) You can sort a directory.
  31.  
  32.      (4) You can restore a deleted file, if the file is not fragmented and has
  33.          not been overwritten.
  34.  
  35.      (5) You can move a file or subdirectory from one directory to another
  36.          without copying its data.
  37.  
  38.      (6) You can recover remnants of deleted files in the empty data clusters.
  39.  
  40.      (7) You can wipe out remnants of deleted files in empty data clusters so
  41.          they cannot be recovered later.
  42.  
  43. Some of these things can't be done even by special programs that issue DOS
  44. calls.  The FILES utility can do them only because it goes around the DOS file
  45. system and accesses the disk on a sector-by-sector basis.
  46.  
  47. The FILES utility works with diskettes and hard disk partitions smaller than
  48. 32 megabytes.  It will not work with larger partitions, such as those used by
  49. DOS 4.00 and later versions of DOS, and it will not work with LAN drives.
  50.  
  51. IMPORTANT: The FILES utility does not recognize any current drive or
  52. subdirectory.  You will have to type an explicit drive specification for every
  53. file, and, for a file not in the root directory, a complete directory path.
  54. Contrary to the usual DOS practice, the directory path must NOT begin with a
  55. backslash.  Sorry about that.
  56.  
  57. The FILES utility and its source code are in the public domain, but the RDCF
  58. 2.0 file package is copyrighted.  If you want to make changes to the FILES
  59. utility for your own use, you will have to obtain RDCF 2.0.  You may make
  60. copies for your own use, but commercial use of RDCF 2.0 requires permission.
  61. You will also need a third package called the Reentrant Cache System 1.1, but
  62. that is also in the public domain.
  63.  
  64. The current version of the FILES utility treats drives other than A: and B: as
  65. read-only.  You can change that if you know what you're doing.
  66.  
  67.  
  68. 2. Bringing up the FILES Utility
  69. --------------------------------
  70.  
  71. The FILES utility resides in the file FILES.EXE.  Copy this file from the
  72. distribution diskette, or download it from a BBS.
  73.  
  74. Make sure the file FILES.EXE is in the current directory, or in a directory
  75. made accessible by the DOS PATH command, and type
  76.  
  77.      FILES
  78.  
  79. in response to the DOS prompt.
  80.  
  81. The FILES utility will then display its prompt:
  82.  
  83.      FILES>
  84.  
  85. Enter FILES commands just as you would enter DOS commands, using the backspace
  86. key to make corrections.  If you have installed a DOS command line editor, it
  87. will probably work with the FILES utility because the utility uses the same
  88. DOS system call (number 10) as the DOS command line interpreter.
  89.  
  90. It is presumed that you are reasonably conversant with DOS commands. 
  91.  
  92. You can execute FILES commands from a file by simply redirecting the file to
  93. the FILES utility as its standard input; e.g.,
  94.  
  95.      FILES  <file
  96.  
  97. Be sure to end the file with an EXIT command, or you'll have to reboot to
  98. regain control of your computer!
  99.  
  100. If you use this technique, remember that the command file is being read by DOS,
  101. not by the FILES utility.  Do not include FILES commands that write to the
  102. drive on which the command file resides.  The FILES utility and DOS will not
  103. cooperate.
  104.  
  105. If you can't remember the FILES commands, just type HELP in response to the
  106. FILES> prompt.  Here is what you'll see:
  107.  
  108.      COPY     source  destination
  109.      DATE     file  month-day-year  hour:min:sec
  110.      DEL      file
  111.      DIR      directory
  112.      DIRSORT  directory
  113.      EXIT
  114.      HELP
  115.      MD       directory
  116.      MCOPY    files directory
  117.      MOVE     source  destination
  118.      RECOVER  file
  119.      REN      old  new
  120.      TYPE     file
  121.      UNDEL    file
  122.      VOLUME   name
  123.      WIPE     drive
  124.  
  125.  
  126. 2.1. COPY - Copy a File
  127. -----------------------
  128.  
  129. The FILES command
  130.  
  131.      COPY  source  destination
  132.  
  133. copies one file to another, just the way DOS does.  However, you cannot copy
  134. multiple files, and you must supply complete file specifications.  For
  135. example, to copy the file FOO.C from drive A: to the subdirectory \PROG on
  136. drive B:, you must type
  137.  
  138.      COPY  A:FOO.C  B:PROG\FOO.C
  139.  
  140. For file copying, you'll probably prefer to use DOS.
  141.  
  142.  
  143. 2.2. DATE - Change the Date and Time of a File, Directory or Volume
  144. -------------------------------------------------------------------
  145.  
  146. The FILES command
  147.  
  148.      DATE  file  month-day-year  hour:min:sec
  149.  
  150. changes the date and time of a file or subdirectory.  The date and time are
  151. expressed in numerical form, and a 24-hour clock is used.  To change the date
  152. and time of the file A:FOO.C to September 15, 1992, 3:15 PM, type
  153.  
  154.      DATE  A:FOO.C  9-15-92 15:13:00
  155.  
  156. If the file specifications represent a subdirectory, its date and time will be
  157. changed.  That's something DOS won't do!
  158.  
  159. If you use a drive specification only, the date and time of the volume label
  160. will be changed.
  161.  
  162.  
  163. 2.3 DEL - Delete a File, Directory or Volume
  164. --------------------------------------------
  165.  
  166. The FILES command
  167.  
  168.      DEL  file
  169.  
  170. deletes the specified file.  If the file specifications represent a
  171. subdirectory, it deletes the subdirectory (provided it is empty).  Hence it
  172. does the work of both the DOS DEL and RD commands.
  173.  
  174. If you use a drive specification only, the volume label will be deleted.
  175.  
  176.  
  177. 2.4. DIR - Directory Listing
  178. ----------------------------
  179.  
  180. The FILES command
  181.  
  182.      DIR  directory
  183.  
  184. lists the contents of the specified directory, including volume labels, hidden
  185. and system files, subdirectories and deleted volume labels, files and
  186. subdirectories.
  187.  
  188. If you use a drive specification only, contents of the root directory will be
  189. displayed.
  190.  
  191. To pause the display, type Ctrl-S; to abort the display, type Ctrl-C.
  192.  
  193.  
  194. 2.5. DIRSORT - Sort a Directory
  195. -------------------------------
  196.  
  197. The FILES command
  198.  
  199.      DIRSORT  directory  mode
  200.  
  201. sorts the entries in the specified directory in the specified manner.
  202.  
  203. The mode may be any ONE of the following:
  204.  
  205.      mode  manner of sort
  206.      ----  -----------------------------------------------------------------
  207.      E     sort by extension, then among files that have the same extension,
  208.              sort by name
  209.      D     sort by date and time (earlier files first)
  210.      N     sort by name, then among files that have the same name, sort by
  211.              extension
  212.      S     sort by size (smallest files first)
  213.  
  214. The letter R may be appended to any of these modes to sort in the opposite
  215. order.  For example, SR sorts the files by size, but it puts the largest files
  216. first.
  217.  
  218. If you omit the mode, N is presumed.
  219.  
  220. Actually, before the FILES utility sorts the directory entries, it first
  221. divides them into five groups and arranges them in the following order:
  222.  
  223.      (1) The two system files at the beginning of the root directory and the
  224.          two special files "." and ".." at the beginning of a subdirectory are
  225.          always left where they are.
  226.  
  227.      (2) The volume label, if any, is put next.
  228.  
  229.      (3) The subdirectory entries, if any, are sorted and put next.
  230.  
  231.      (4) The file entries are sorted and put next.
  232.  
  233.      (5) The entries for del